{ }
//1 unkown类型
var a = 'hello word!';
var b = a;
console.log(a);
var c = '99';
var d = c;
console.log(d);
//2 void和never的区别
var fn1 = function () {
    return undefined || null;
};
var fn2 = function () {
    throw new Error('出错啦');
};
//3 函数的声明
// 3.1 推断
var fn3 = function (name, age) {
    return [1, 2, 3];
};
// 3.2 类型声明
var fn32 = function (name, age) {
    return [1, 'wdq', false];
};
// 3.3 结构定义 结合接口
var Sex;
(function (Sex) {
    Sex[Sex["boy"] = 0] = "boy";
    Sex[Sex["girl"] = 1] = "girl";
})(Sex || (Sex = {}));
var fn4 = function (user) {
    console.log(user.name + user.age + (user.sex ? user.sex : 0));
};
fn4({
    name: 'liming',
    age: 14,
    // sex: 2,
    color: 'agreen'
});
//4 剩余参数的使用
function fn5(arr) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
    }
    arr.push(args);
    return arr;
}
console.log(fn5(['arr:'], 1, 'hello', true));
//5 元组的使用
var arr = [null, 99, 'csdcd'];
// arr[0].length; 
console.log(arr);
var arr2 = [false, 'anme', 99];
console.log(arr2[1].length);
// 6 断言
// 不同写法
var aa = '小黄';
var bb = '小红';
var ee = '小懒222';
// let ee = <const>'小懒222';
var ff = [aa, 1, true, 'hello'];
var ff2 = [aa, 1, true, 'hello'];
var ff3 = [aa, 1, true, 'hello'];
var gg = {
    name: aa
};
var cc = '小懒';
cc = 'csca';
// 结构中使用断言
function hd() {
    var a = 'www.baidu.com';
    var b = function (name, age) { return name + age; };
    return [a, b];
}
;
// (1)
// let [m, n] = hd();
// console.log((n as (name: string, age: number) => string)('zhangsan', 13))
// (2)
var _a = hd(), m = _a[0], n = _a[1];
// console.log((n as Function)('lisi', 99))
// (3)
function hd2() {
    var a = 'www.baidu.com';
    var b = function (name, age) { return name + age; };
    return [a, b];
}
;
var _b = hd2(), mm = _b[0], nn = _b[1];
// console.log(nn('lisi', 99))
// (4)
function hd3() {
    var a = 'www.baidu.com';
    var b = function (name, age) { return name + age; };
    return [a, b];
}
;
var _c = hd3(), m1 = _c[0], n1 = _c[1];
// console.log(n1('lisi', 99))
// (5)
function hd4() {
    var a = 'www.baidu.com';
    var b = function (name, age) { return name + age; };
    return [a, b];
}
;
var _d = hd4(), m2 = _d[0], n2 = _d[1];
console.log(n2('lisi00', 99));
// 非空断言
var div = document.querySelector('#hd');
var div2 = document.querySelector('#hd');
var body = document.querySelector('body');
